import request from "@/utils/request";
import { GetSchedule, OrderDetail, OrderList, OrderStatus, PatientAuth, PatientList, PostPatientPatam } from "./type/user";
import { CmnList, RegionList, Result } from "./type/globale";

//获取就诊人
export const getUserPatientAPI=(id:string)=>request.get<any,Result<PatientAuth>>(`/user/patient/auth/get/${id}`)

//删除就诊人
export const deleteUserPatientAPI=(id:string)=>request.delete(`/user/patient/auth/remove/${id}`)

//获取就诊列表
export const getPatientListAPI=()=>request.get<any,Result<PatientList>>('/user/patient/auth/findAll')


//新增就诊人
export const postPatientAPI=(data:PostPatientPatam)=>request.post('/user/patient/auth/save',data)

//修改就诊人
export const updatePatientAPI=(data:PostPatientPatam)=>request.put('/user/patient/auth/update',data)


//获取订单状态列表
export const getOrderStatusAPI=()=>request.get<any,Result<OrderStatus>>('/order/orderInfo/auth/getStatusList')

//获取订单分页列表
export const getOrderListAPI=(page:number,limit:number,patientId?:string,orderStatus?:string)=>request.get<any,Result<OrderList>>(`/order/orderInfo/auth/${page}/${limit}?patientId=${patientId}&orderStatus=${orderStatus}`)

//获取订单详情
export const getOrderDetailAPI=(id:string)=>request.get<any,Result<OrderDetail>>(`/order/orderInfo/auth/getOrderInfo/${id}`)

//根据排班id获取排班数据
export const getScheduleAPI=(scheduleId:string)=>request.get<any,Result<GetSchedule>>(`/hosp/hospital/getSchedule/${scheduleId}`)

//获取证件类型
export const getCmnListAPI=(dictCode='CertificatesType')=>request.get<any,Result<CmnList>>(`/cmn/dict/findByDictCode/${dictCode}`)

//获取地区数据
export const getRegionAPI=(parentId:string)=>request.get<any,Result<RegionList>>(`/cmn/dict/findByParentId/${parentId}`)